package com.wiscamp.ninechapters.panels.domain.repositories;

import com.wiscamp.ninechapters.panels.domain.entities.Role;
import cube.ddd.common.query.PagedObjects;
import cube.ddd.common.query.PagedQuery;

import java.util.Collection;

public interface RoleRepository {

    Role getRole(long roleId);

    Role getRoleByCode(long appId, String roleCode);

    Collection<Role> getRolesByName(long appId, String roleName);

    Collection<Role> getRolesByIds(Collection<Long> roleIds);

    Collection<Role> getAvailableRoles(long appId);

    PagedObjects<Role> getRolesByQuery(PagedQuery query);

    Role saveRole(Role role);

    boolean bindRoleMenu(long roleId, long menuId);

    boolean unbindRoleMenu(long roleId, long menuId);

    boolean bindRolePermission(long roleId, long permissionId);

    boolean unbindRolePermission(long roleId, long permissionId);
}
